﻿#ifndef TCPFILETRANS_H
#define TCPFILEPOST_H

#include <QObject>
#include <QAbstractSocket>
#include <QTcpSocket>
#include <QFile>

class tcpFilePost: public QObject
{
    Q_OBJECT
public:
    tcpFilePost();

    void send(QString,QString,QString);

signals:
    void sig_PostProgress(int);
    void sig_PostError(QString);

private:
    QTcpSocket *m_tcpClient;
    QFile *m_localFile;
    qint64 m_totalBytes;
    qint64 m_bytesWritten;
    qint64 m_bytesToWrite;
    qint64 m_payloadSize;
    QString m_fileName;
    QByteArray m_outBlock;

private slots:
    void startTransfer();
    void updateClientProgress(qint64);
    void displayError(QAbstractSocket::SocketError);

};

#endif // TCPFILEPOST_H
